package com.lc.luzhengtang.adapter;

import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.lc.luzhengtang.R;
import com.lc.luzhengtang.bean.CommentDetailBean;
import com.zcx.helper.scale.ScaleScreenHelperFactory;

import java.util.List;

/**
 * https://github.com/CymChad/BaseRecyclerViewAdapterHelper
 */
public class CommentSectionAdapter extends BaseQuickAdapter<CommentDetailBean.DataBean, BaseViewHolder> {

    RecyclerView recyclerView;
    SectionDetailAdapter sectionItemAdapter;
    List<CommentDetailBean.DataBean> dataBeen;
    public CommentSectionAdapter(List<CommentDetailBean.DataBean> data) {
        super(R.layout.item_comment, data);

    }

    @Override
    protected void convert(BaseViewHolder helper, final CommentDetailBean.DataBean item) {
        ScaleScreenHelperFactory.getInstance().loadView((ViewGroup) helper.convertView);
        recyclerView = helper.getView(R.id.recycle_personal_list);
        recyclerView.setLayoutManager(new LinearLayoutManager(mContext));
        sectionItemAdapter = new SectionDetailAdapter(dataBeen);

        if (item != null) {

            recyclerView.setAdapter(sectionItemAdapter);
        }

        helper.addOnClickListener(R.id.text_order_detail);
        View view = helper.getConvertView();
        view.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
//                CommentListActivity
//                mContext.startActivity(new Intent(mContext, CommentListActivity2.class));
              /*  Intent intent = new Intent();
                intent.putExtra("ordersn",item.getOrdersn());
//                status

                intent.setClass(mContext, OrderDetailActivity2.class);
                mContext.startActivity(intent);*/
            }
        });
    }


}
